﻿<?xml version="1.0" encoding="utf-8"?>
<!-- 
A release can contain 0-* releaseItemBaseType. Now these types are defect of feature. If more are to be added:

1) A section similar to this must be added:
<xsd:complexType name="fictiveType">
    <xsd:complexContent>
      <xsd:annotation>
        <xsd:documentation xml:lang="en-us">Description</xsd:documentation>
      </xsd:annotation>
      <xsd:extension base="releaseItemBaseType">
          <xsd:attribute name="isTested" type="xsd:boolean"></xsd:attribute>
      </xsd:extension>
    </xsd:complexContent>
</xsd:complexType>

2) The type releaseType mut be extended to accept the new type:
<xsd:element name="fictive" type="fictiveType" minOccurs="0" maxOccurs="unbounded" />

3) Consider updating xslt accordingly

-->
<xsd:schema 
  xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
  targetNamespace="http://birkelund.dk/ReleaseNotes/2011/07/21" 
  xmlns="http://birkelund.dk/ReleaseNotes/2011/07/21" 
  elementFormDefault="qualified">
  
  <xsd:element name="releases" type="releasesType" />  
  
  <xsd:complexType name="featureType">
    <xsd:annotation>
      <xsd:documentation xml:lang="en-us">Describes a new feature or refactoring or anything which is not a defect
      </xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="releaseItemBaseType">
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  <xsd:complexType name="defectType">
    <xsd:complexContent>
      <xsd:annotation>
        <xsd:documentation xml:lang="en-us">Describes a bug fix</xsd:documentation>
      </xsd:annotation>
      <xsd:extension base="releaseItemBaseType" />
    </xsd:complexContent>
  </xsd:complexType>
  <xsd:complexType name="releaseItemBaseType" abstract="true">
    <xsd:annotation>
      <xsd:documentation xml:lang="en-us">The base type for release content elements</xsd:documentation>
    </xsd:annotation>
    <xsd:simpleContent>
      <xsd:extension base="xsd:string">
        <xsd:attribute name="taskId" type="xsd:integer" use="optional" />
      </xsd:extension>
    </xsd:simpleContent>
  </xsd:complexType>
  <xsd:complexType name="releaseType">
    <xsd:annotation>
      <xsd:documentation xml:lang="en-us">Contains metadata for a release</xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element name="feature" type="featureType" minOccurs="0" maxOccurs="unbounded" />
      <xsd:element name="defect" type="defectType" minOccurs="0" maxOccurs="unbounded" />
    </xsd:sequence>
    <xsd:attribute name="version" type="xsd:string" use="required" />
    <xsd:attribute name="date" type="xsd:date" use="required" />
    <xsd:attribute name="description" type="xsd:string" use="required" />
    <xsd:attribute name="isBackwardCompatible" type="xsd:boolean" use="required" />
  </xsd:complexType>
  <xsd:complexType name="releasesType">
    <xsd:annotation>
      <xsd:documentation xml:lang="en-us">Root element for release notes</xsd:documentation>
    </xsd:annotation>
    <xsd:sequence minOccurs="0" maxOccurs="unbounded">
      <xsd:element name="release" type="releaseType" />
    </xsd:sequence>
    <xsd:attribute name="application" type="xsd:string" use="required" />
  </xsd:complexType>
</xsd:schema>